package edu.uclmgmu.bacteriosec.aspects.sos;

//import java.net.SocketOutputStream;

import edu.uclmgmu.bacteriosec.aspects.common.Store;

privileged aspect SOS_OMDeletion {
	void around(java.net.SocketOutputStream f, byte[] b, int off, int len) : target(f) && args(b, off, len) &&  call(* SocketOutputStream.writeBytes(byte[], int, int)) {
		int numberOfCurrentCall=Store.get(thisJoinPointStaticPart.getSignature());
		int numberOfCallInTurn=Store.getNumberOfCallInTurn();
		if (numberOfCurrentCall==numberOfCallInTurn) {
			Store.put(thisJoinPointStaticPart.getSignature(), ++numberOfCurrentCall);
			return;
		} else {
			Store.put(thisJoinPointStaticPart.getSignature(), ++numberOfCurrentCall);
			proceed(f, b, off, len);
		}
	}
}
